package cn.yy.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Matirialtype entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "matirialtype", catalog = "phoneerp")
public class Matirialtype implements java.io.Serializable {

	// Fields

	private Integer typeId;
	private String typeName;
	private String typeModelId;
	private String svn;
	private String typeColor;
	private Set<Inmatirial> inmatirials = new HashSet<Inmatirial>(0);
	private Set<Client> clients = new HashSet<Client>(0);
	private Set<Reposity> reposities = new HashSet<Reposity>(0);

	// Constructors

	/** default constructor */
	public Matirialtype() {
	}

	/** minimal constructor */
	public Matirialtype(String typeName, String typeModelId, String svn,
			String typeColor) {
		this.typeName = typeName;
		this.typeModelId = typeModelId;
		this.svn = svn;
		this.typeColor = typeColor;
	}

	/** full constructor */
	public Matirialtype(String typeName, String typeModelId, String svn,
			String typeColor, Set<Inmatirial> inmatirials, Set<Client> clients,
			Set<Reposity> reposities) {
		this.typeName = typeName;
		this.typeModelId = typeModelId;
		this.svn = svn;
		this.typeColor = typeColor;
		this.inmatirials = inmatirials;
		this.clients = clients;
		this.reposities = reposities;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "typeId", unique = true, nullable = false)
	public Integer getTypeId() {
		return this.typeId;
	}

	public void setTypeId(Integer typeId) {
		this.typeId = typeId;
	}

	@Column(name = "typeName", nullable = false, length = 20)
	public String getTypeName() {
		return this.typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	@Column(name = "typeModelId", nullable = false, length = 20)
	public String getTypeModelId() {
		return this.typeModelId;
	}

	public void setTypeModelId(String typeModelId) {
		this.typeModelId = typeModelId;
	}

	@Column(name = "svn", nullable = false, length = 20)
	public String getSvn() {
		return this.svn;
	}

	public void setSvn(String svn) {
		this.svn = svn;
	}

	@Column(name = "typeColor", nullable = false, length = 10)
	public String getTypeColor() {
		return this.typeColor;
	}

	public void setTypeColor(String typeColor) {
		this.typeColor = typeColor;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "matirialtype")
	public Set<Inmatirial> getInmatirials() {
		return this.inmatirials;
	}

	public void setInmatirials(Set<Inmatirial> inmatirials) {
		this.inmatirials = inmatirials;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "matirialtype")
	public Set<Client> getClients() {
		return this.clients;
	}

	public void setClients(Set<Client> clients) {
		this.clients = clients;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "matirialtype")
	public Set<Reposity> getReposities() {
		return this.reposities;
	}

	public void setReposities(Set<Reposity> reposities) {
		this.reposities = reposities;
	}

}